package com.huizu.project.service.impl;

import java.util.List;

import cn.hutool.http.useragent.UserAgentUtil;
import com.huizu.common.core.domain.entity.SysUser;
import com.huizu.common.utils.DateUtils;
import com.huizu.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.huizu.project.mapper.ProLabourEducationConfigMapper;
import com.huizu.project.domain.ProLabourEducationConfig;
import com.huizu.project.service.IProLabourEducationConfigService;

/**
 * 劳动教育配置Service业务层处理
 * 
 * @author pjl
 * @date 2024-09-10
 */
@Service
public class ProLabourEducationConfigServiceImpl implements IProLabourEducationConfigService 
{
    @Autowired
    private ProLabourEducationConfigMapper proLabourEducationConfigMapper;

    /**
     * 查询劳动教育配置
     * 
     * @param id 劳动教育配置主键
     * @return 劳动教育配置
     */
    @Override
    public ProLabourEducationConfig selectProLabourEducationConfigById(Long id)
    {
        return proLabourEducationConfigMapper.selectProLabourEducationConfigById(id);
    }

    /**
     * 查询劳动教育配置列表
     * 
     * @param proLabourEducationConfig 劳动教育配置
     * @return 劳动教育配置
     */
    @Override
    public List<ProLabourEducationConfig> selectProLabourEducationConfigList(ProLabourEducationConfig proLabourEducationConfig)
    {
        return proLabourEducationConfigMapper.selectProLabourEducationConfigList(proLabourEducationConfig);
    }

    /**
     * 新增劳动教育配置
     * 
     * @param proLabourEducationConfig 劳动教育配置
     * @return 结果
     */
    @Override
    public int insertProLabourEducationConfig(ProLabourEducationConfig proLabourEducationConfig)
    {
        SysUser user = SecurityUtils.getLoginUser().getUser();
        proLabourEducationConfig.setCreateBy(user.getUserId().toString());
        return proLabourEducationConfigMapper.insertProLabourEducationConfig(proLabourEducationConfig);
    }

    /**
     * 修改劳动教育配置
     * 
     * @param proLabourEducationConfig 劳动教育配置
     * @return 结果
     */
    @Override
    public int updateProLabourEducationConfig(ProLabourEducationConfig proLabourEducationConfig)
    {
        return proLabourEducationConfigMapper.updateProLabourEducationConfig(proLabourEducationConfig);
    }

    /**
     * 批量删除劳动教育配置
     * 
     * @param ids 需要删除的劳动教育配置主键
     * @return 结果
     */
    @Override
    public int deleteProLabourEducationConfigByIds(Long[] ids)
    {
        return proLabourEducationConfigMapper.deleteProLabourEducationConfigByIds(ids);
    }

    /**
     * 删除劳动教育配置信息
     * 
     * @param id 劳动教育配置主键
     * @return 结果
     */
    @Override
    public int deleteProLabourEducationConfigById(Long id)
    {
        return proLabourEducationConfigMapper.deleteProLabourEducationConfigById(id);
    }
}
